<?xml version="1.0"  encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/TR/WD-xsl">

  <xsl:template match="/">
      <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="xtree">
   
	<xsl:if test="@target">
		<base>
			<xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
		</base>
	</xsl:if>
	
	<STYLE>
	body { margin-left: 8px;margin-right: 0px;font-size: 9.5pt;}
	.nodeheader {font-size: 9.5pt;text-decoration:none;}
	.nodedocuments { font-size: 9.5pt; border-style: none;text-decoration:none;}
	a:link {font-family:"宋体";font-size: 9.5pt;color: #0099FF;TEXT-DECORATION: none; }
	a:visited {font-family:"宋体";font-size: 9.5pt;color: #0099FF;TEXT-DECORATION: none; }
	a:hover {font-family:"宋体";font-size: 9.5pt;color:#FF6600;TEXT-DECORATION: underline; }
	a:active {font-family:"宋体";font-size: 9.5pt;color: #FF6600;TEXT-DECORATION: underline; }
	</STYLE>
    	<SCRIPT><xsl:comment><![CDATA[
		    //Open or close nodes
		 
    		function SetNode(nodename) {
    			if (eval("documents" + nodename + ".style.display == 'none';")) {
				// Open
	    			eval("image" + nodename + ".src = 'images/minus.png'");
	    			//eval("nodeimage" + nodename + ".src = 'images/open.gif'");
	    			eval("documents" + nodename + ".style.display = 'block'");
    				}
				else {
					// Close
	    			eval("image" + nodename + ".src = 'images/plus.png'");
	    			//eval("nodeimage" + nodename + ".src = 'images/closed.gif'");
	    			eval("documents" + nodename + ".style.display = 'none'");
    				}
	    		}
       		]]>//</xsl:comment></SCRIPT>
    	
    	<BODY>
		  <nobr>
        	<xsl:apply-templates/>
		  </nobr>
        </BODY>
   
  </xsl:template>

  <xsl:template match="logo">
      <DIV class="nodeheader">
	<IMG SRC="images/managerlogo.gif">
	<xsl:attribute name="alt"><xsl:value-of select="@title"/></xsl:attribute>
	</IMG>   
      </DIV>
     
   </xsl:template>
  
  <xsl:template match="node">
      <DIV class="nodeheader">
      	<xsl:attribute name="id">Node<xsl:value-of select="@id"/></xsl:attribute>
      	<xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
      	
		<!--  '+' or '-' symbols for an open or closed node -->
		<xsl:choose>
			<xsl:when test="@opened[.='1']">
		    	<IMG SRC="images/minus.png">
		      		<xsl:attribute name="id">image<xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="onClick">SetNode('<xsl:value-of select="@id"/>');</xsl:attribute>
		    	</IMG>
		    	<!-- <IMG SRC="images/open.gif"> -->
		      		<xsl:attribute name="id">nodeimage<xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="onDblClick">SetNode('<xsl:value-of select="@id"/>');</xsl:attribute>
		    	<!-- </IMG> -->
		    </xsl:when>
    		<xsl:otherwise>
			<IMG SRC="images/plus.png">
		      	<xsl:attribute name="id">image<xsl:value-of select="@id"/></xsl:attribute>
				<xsl:attribute name="onClick">SetNode('<xsl:value-of select="@id"/>');</xsl:attribute>
			</IMG>
		    	<!-- <IMG SRC="images/closed.gif"> -->
		      		<xsl:attribute name="id">nodeimage<xsl:value-of select="@id"/></xsl:attribute>
					<xsl:attribute name="onDblClick">SetNode('<xsl:value-of select="@id"/>');</xsl:attribute>
		    	<!-- </IMG> -->
		</xsl:otherwise>
		</xsl:choose>

		<xsl:choose>
			<xsl:when test="@url">
		      <A>
				<xsl:attribute name="HREF"><xsl:value-of select="@url"/></xsl:attribute>
				<xsl:if test="@target">
					<xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
				</xsl:if>
		        <xsl:value-of select="@name"/>
		      </A>
 		    </xsl:when>
    		<xsl:otherwise>
		        <xsl:value-of select="@name"/>
		    </xsl:otherwise>
		</xsl:choose>
   
      </DIV>
      
      <DIV class="nodedocuments">
      	<xsl:attribute name="id">documents<xsl:value-of select="@id"/></xsl:attribute>
      
 		<xsl:choose>
			<xsl:when test="@opened[.='1']">
		    	<xsl:attribute name="Style">display: block; Margin-left: 10;</xsl:attribute>
		    </xsl:when>
    		<xsl:otherwise>
		    	<xsl:attribute name="Style">display: none; Margin-left: 10;</xsl:attribute>
		    </xsl:otherwise>
		</xsl:choose>
       	
      	<xsl:apply-templates />
      </DIV>
   </xsl:template>


  <xsl:template match="document">
     <DIV Class="document">
     <!-- 	<IMG SRC="images/blank.gif" /> -->
     	<IMG SRC="images/page.png" />
     	
		<xsl:choose>
			<xsl:when test="@url">
		      <A>
				<xsl:attribute name="HREF"><xsl:value-of select="@url"/></xsl:attribute>
				<xsl:if test="@target">
					<xsl:attribute name="target"><xsl:value-of select="@target"/></xsl:attribute>
				</xsl:if>
		        <xsl:apply-templates />
		      </A>
 		    </xsl:when>
    		<xsl:otherwise>
		        <xsl:apply-templates />
		    </xsl:otherwise>
		</xsl:choose>
     	
     </DIV>
  </xsl:template>
  
  <xsl:template match="text()">
  	<xsl:value-of />
  </xsl:template>

</xsl:stylesheet>